<?php
class Jnd_Form extends Zend_Form {
  
  public function __construct( $decorateur = "FormulaireLabel", $options = null, $exclusions = array() ) {

    $formDecorators = array(
      'FormElements', 
      'Form', 
      array(
        'decorator' => array(
          '1er' => 'HtmlTag'
        ), 
        'options' => array(
          'tag' => 'div', 
          'id' => 'formulaire'
        ), 
        'File' => array(
          'tag' => 'div', 
          'class' => 'form-table'
        )
      )
    );
    
    //  ON force le type de formulaire à post
    $this->setMethod("post");
    // Doit �tre en bas de forumlaire
    $this->addPrefixPath("Jnd_Form", "Jnd/Form");
    $this->addElementPrefixPath("Jnd_Validate", "Jnd/Validate", "validate");
    $this->addElementPrefixPath("Jnd", "Jnd", "validate");
    
    /*
    * on d�finie les d�corateurs des champs
    */
//     $this->addElementPrefixPath("Osml_Form_Decorator", "Oml/Form/Decorator", "decorator");
    $this->addElementPrefixPath("Jnd_Form_Decorator", "Jnd/Form/Decorator", "decorator");
    $this->setElementDecorators(array(
      'Formulaire'
    ));
    $this->setDisableLoadDefaultDecorators(true);
    parent::__construct($options);
    $this->setElementDecorators(array(
      "$decorateur"
    ), $exclusions, false);
    $allowedTags = array(
      'b', 
      'i', 
      'br', 
      'font',
      'strong'
    );
    $allowedAttributes = array(
      'size', 
      'face'
    );
    $filter = new Zend_Filter_StripTags($allowedTags, $allowedAttributes);
    $filtres = array(
      'StringTrim', 
      $filter
    );
    //$this->setElementFilters($filtres);
    $this->setDecorators($formDecorators);
    $this->setAttrib("id", $this->getName() . "Form");
  }
}

